<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Search.aspx.cs" Inherits="ScrewTurn.Wiki.Search" ValidateRequest="false" Title="Untitled Page" Culture="auto" meta:resourcekey="PageResource1" UICulture="auto" %>

<asp:Content ID="CtnSearch" ContentPlaceHolderID="CphMaster" Runat="Server">

    <h1 class="pagetitlesystem"><asp:Literal ID="lblSearch" runat="server" meta:resourcekey="lblSearchResource1" Text="Search" /></h1>
    <p><asp:Literal ID="lblDescription" runat="server" meta:resourcekey="lblDescriptionResource1" Text="Here you can search through the pages of the Wiki.<br />It's a good habit to perform a search before creating a new page that may already exist in the Wiki."></asp:Literal></p>
    <br />
    
    <div id="SearchCatExtDiv">
		<p><asp:Literal ID="lblCategories" runat="server" Text="Filter by Categories" meta:resourcekey="lblCategoriesResource1" /><br />
			<a href="#" onclick="javascript:return __SelectAll();"><asp:Literal id="lblAll" runat="server" Text="All" meta:resourcekey="lblAllResource1" /></a> -
			<a href="#" onclick="javascript:return __DeselectAll();"><asp:Literal ID="lblNone" runat="server" Text="None" meta:resourcekey="lblNoneResource1" /></a> -
			<a href="#" onclick="javascript:return __Invert();"><asp:Literal ID="lblInvert" runat="server" Text="Invert" meta:resourcekey="lblInvertResource1" /></a>
		</p>
		<div id="SearchCatDiv">
			<asp:CheckBox ID="chkUncategorized" runat="server" Text="Uncategorized Pages" Checked="True" style="font-style: italic;" meta:resourcekey="chkUncategorizedResource1" /><br />
			<asp:CheckBoxList ID="lstCategories" runat="server" RepeatDirection="Vertical" RepeatLayout="Flow" meta:resourcekey="lstCategoriesResource1" />
		</div>
    </div>
    
    <div id="SearchControlsDiv">
		<p><asp:Literal ID="lblSearchTerms" runat="server" meta:resourcekey="lblSearchTermsResource1" Text="Search terms" /></p>
		<asp:TextBox ID="txtSearch" runat="server" Width="350px" meta:resourcekey="txtSearchResource1" ToolTip="Type here your search terms" />
		<asp:Button ID="btnGo" runat="server" Text="Go" meta:resourcekey="btnGoResource1" OnClick="btnGo_Click" ToolTip="Click here to start the search" /><br />
		<asp:CheckBox ID="chkFullSearch" runat="server" Text="Full-text search (slower)" ToolTip="Check this to search the pages title AND contents" meta:resourcekey="chkFullSearchResource1" />
		<br /><br />
		<div id="SearchInstructionsDiv">
			<asp:Literal ID="lblSearchInstructions" runat="server" meta:resourcekey="lblSearchInstructionsResource1"
				Text="You can use the following options:<br /><ul><li>Double quotes to search an exact phrase, for example <i>&quot;this is an exact phrase&quot;</i></li><li>Asterisk for any character sequence, for example <i>cust* search terms</i></li><li>Question mark for any single character, for example <i>search a?c</i></li></ul>" />
		</div>
    </div>
    
    <div id="SearchResultsDiv">
		<asp:Literal ID="lblResults" runat="server" meta:resourcekey="lblResultsResource1" />
	</div>
   
    <script type="text/javascript">
    <!--
		__GetServerElementById("txtSearch").focus();
         
        function __SelectAll() {
			var ck = document.getElementsByTagName("input");
			for(i = 0; i < ck.length; i++) {
				if(ck[i].type.toLowerCase() == "checkbox" &&
					ck[i].id.indexOf("lstCategories") != -1) ck[i].checked = true;
			}
			__GetServerElementById("chkUncategorized").checked = true;
			return false;
        }
        
        function __DeselectAll() {
			var ck = document.getElementsByTagName("input");
			for(i = 0; i < ck.length; i++) {
				if(ck[i].type.toLowerCase() == "checkbox" &&
					ck[i].id.indexOf("lstCategories") != -1) ck[i].checked = false;
			}
			__GetServerElementById("chkUncategorized").checked = false;
			return false;
        }
        
        function __Invert() {
			var ck = document.getElementsByTagName("input");
			for(i = 0; i < ck.length; i++) {
				if(ck[i].type.toLowerCase() == "checkbox" &&
					ck[i].id.indexOf("lstCategories") != -1) ck[i].checked = !ck[i].checked;
			}
			__GetServerElementById("chkUncategorized").checked = !__GetServerElementById("chkUncategorized").checked;
			return false;
        }
    // -->
    </script> 

</asp:Content>

